<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <meta HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
    <meta HTTP-EQUIV="Expires" CONTENT="0">
    <link href="../pic/logo.ico" rel="shortcut icon">
    <link rel="stylesheet" href="../lib/element/index.css">
    <link rel="stylesheet" href="../../node_modules/animate.css/animate.min.css">
    <link href="../lib/font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <link rel="stylesheet" href="../common/common.css">
    <title>项目列表</title>
    <style>
        .el-tabs--card>.el-tabs__header .el-tabs__item.is-active
        {
            border-bottom-color:transparent;
        }
        .el-tabs__nav
        {
            float: none;
        }
        .el-tabs__nav-scroll
        {
            text-align: center;
        }
        .el-tabs__nav
        {
            background-color: white;
        }
        .el-tabs__header
        {
            box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.15);
        }
    </style>
</head>
<body>
<div class="container" id="app" style="margin: 0px;height: 600px;width: 100%" v-cloak>
    <mainnav>
        <el-row class="row" style="text-align: center;height: 50px;line-height: 50px;font-size: 25px;color: #50bfff" slot="title">列表</el-row>
        <el-popover ref="popover" placement="bottom" width="250" trigger="hover" slot="other">
            <span style="font-size: 15px;color: red">
                支持postman v2格式的JSON,DOClever导出JSON,RAP的导出JSON，Swagger的导出url和JSON
            </span>
        </el-popover>
        <el-dropdown slot="slot2">
            <el-button type="text" style="font-size: 15px;width:40px;height: 50px" class="el-dropdown-link">
                添加
            </el-button>
            <el-dropdown-menu slot="dropdown">
                <el-dropdown-item @click.native="showAdd=true">添加项目</el-dropdown-item>
                <el-dropdown-item @click.native="showTeam=true">添加团队</el-dropdown-item>
            </el-dropdown-menu>
        </el-dropdown>
        <el-button type="text" v-popover:popover style="font-size: 15px;width:40px;height: 50px" slot="slot1" title="导入项目" @click="importProject">
            导入
        </el-button>
    </mainnav>
    <div style="width: 100%;height:calc(100vh - 65px);top: 65px;overflow-y: auto;position: fixed;">
        <el-tabs v-model="tab" type="card">
            <el-tab-pane label="项目" name="project">
                <projectlist></projectlist>
            </el-tab-pane>
            <el-tab-pane label="团队" name="team">
                <teamlist></teamlist>
            </el-tab-pane>
        </el-tabs>
    </div>
    <el-dialog title="新建项目" v-model="showAdd" size="small">
        <el-form ref="form" label-width="100px">
            <el-form-item label="名称">
                <el-input  style="width: 80%"  v-model="name" placeholder="请输入新项目的名称"></el-input>
            </el-form-item>
            <el-form-item label="描述">
                <el-input type="textarea" :rows="2"  style="width: 80%"  v-model="dis" placeholder="请输入新项目的简介"></el-input>
            </el-form-item>
        </el-form>
        <span slot="footer" class="dialog-footer">
            <el-button @click="showAdd = false">取 消</el-button>
            <el-button type="primary" @click="addProject" :loading="addPending">确 定</el-button>
        </span>
    </el-dialog>
    <el-dialog title="新建团队" v-model="showTeam" size="small">
        <el-form ref="form" label-width="100px">
            <el-form-item label="名称">
                <el-input  style="width: 80%"  v-model="name" placeholder="请输入新团队的名称"></el-input>
            </el-form-item>
            <el-form-item label="描述">
                <el-input type="textarea" :rows="2"  style="width: 80%"  v-model="dis" placeholder="请输入新团队的简介"></el-input>
            </el-form-item>
        </el-form>
        <span slot="footer" class="dialog-footer">
            <el-button @click="showTeam = false">取 消</el-button>
            <el-button type="primary" @click="addTeam" :loading="addPending">确 定</el-button>
        </span>
    </el-dialog>
    <el-dialog title="请求列表" v-model="showApply" size="small">
        <el-row class="row" style="height: 300px;overflow-y: auto">
            <table class="table-hover" style="width: 100%">
                <template v-for="item in $store.state.arrApply">
                    <tr class="row"  style="height: 40px;text-align: center;vertical-align: middle">
                        <td style="width: 70%">
                            团队<span style="color: #00adef">{{item.from.name}}</span>拉你加入
                        </td>
                        <td style="width: 30%">
                            <template v-if="item.handle==0">
                                <el-button type="primary" @click="handleApply(item,1)">
                                    同意
                                </el-button>&nbsp;&nbsp;
                                <el-button type="danger" @click="handleApply(item,2)">
                                    拒绝
                                </el-button>
                            </template>
                            <span v-else-if="item.handle==1">
                            已同意
                            </span>
                            <span v-else-if="item.handle==2">
                            已拒绝
                            </span>
                            <span v-else>
                            已忽略
                            </span>
                        </td>
                    </tr>
                </template>
            </table>
        </el-row>
    </el-dialog>
</div>
<script src="../../dist/vendor.bundle.js"></script>
<script src="../lib/element/index.js"></script>
<script src="../../dist/project.js"></script>
</body>
</html>